package com.qf.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;

/**
 * --- 就那样---
 *
 * @author zzw
 * @date 2025/8/16
 * @desc
 */
@Controller
public class Demo3Controller {
    @RequestMapping("/session/set")
    public  String show1(HttpSession session){
        session.setAttribute("user","admin");
        return "/ok.html";

    }
    @RequestMapping("/session/get")
    public  String show2(HttpSession session){
        session.getAttribute("user");
        return "/ok.html";

    }
    @RequestMapping("/session/remove")
    public  String show3(HttpSession session){
        session.invalidate();
        return "/ok.html";

    }
}